<div class="panel panel-default" ng-controller="userorderCtrl">
	<div class="panel-heading">订票管理 / 订单列表</div>
	<toaster-container
		toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
	<div class="row wrapper m-n">
		<form class="bs-example form-horizontal ng-pristine ng-valid">
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<input type="text" ng-model="queryMap.orderNo" class="form-control"
						placeholder="订单号">
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<input type="text" ng-model="queryMap.orderDetail__contactName"
						class="form-control" placeholder="联系人姓名">
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<input type="text" ng-model="queryMap.orderDetail__contactPhone"
						class="form-control" placeholder="联系人手机号">
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<div class="input-group">
						<ui-select ng-model="statusList.selected" theme="bootstrap">
						<ui-select-match placeholder="订单状态">{{$select.selected.name}}</ui-select-match>
						<ui-select-choices
							repeat="status in statusList | propsFilter: {name: $select.search}">
						<span ng-bind-html=" status.name| highlight: $select.search"></span>
						</ui-select-choices> </ui-select>
						<span class="input-group-btn">
							<button ng-click="statusList.selected = undefined"
								class="btn btn-default">
								<span class="glyphicon glyphicon-trash"></span>
							</button>
						</span>
					</div>
				</div>
			</div>
            <div class="form-group col-md-1">
                <div class="col-md-11">
					<button type="button" class="btn btn-info" ng-click="sync()">同步订单信息</button>
                </div>
            </div>
			<div class="form-group col-md-3" ng-controller="DatepickerDemoCtrl">
				<div class="col-md-11">
					<div class="input-group">
						<input type="text" class="form-control"
							datepicker-popup="{{format}}" is-open="opened"
							ng-model="timeRange.startTime" datepicker-options="dateOptions"
							close-text="Close" placeholder="订单开始时间" readOnly /> <span
							class="input-group-btn">
							<button type="button" class="btn btn-default"
								ng-click="open($event)">
								<i class="glyphicon glyphicon-calendar"></i>
							</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-3" ng-controller="DatepickerDemoCtrl">
				<div class="col-md-11">
					<div class="input-group">
						<input type="text" class="form-control"
							datepicker-popup="{{format}}" is-open="opened"
							ng-model="timeRange.endTime" datepicker-options="dateOptions"
							close-text="Close" placeholder="订单结束时间" readOnly /> <span
							class="input-group-btn">
							<button type="button" class="btn btn-default"
								ng-click="open($event)">
								<i class="glyphicon glyphicon-calendar"></i>
							</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<input type="text" ng-model="queryMap.orderDetail__shiftNo"
						class="form-control" placeholder="车次号">
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<div class="input-group">
						<ui-select ng-model="starList.selected" theme="bootstrap">
						<ui-select-match placeholder="始发客运站">{{$select.selected.name}}</ui-select-match>
						<ui-select-choices
							repeat="star in starList | propsFilter: {name: $select.search}">
						<span ng-bind-html=" star.name| highlight: $select.search"></span>
						</ui-select-choices> </ui-select>
						<span class="input-group-btn">
							<button ng-click="starList.selected = undefined"
								class="btn btn-default">
								<span class="glyphicon glyphicon-trash"></span>
							</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-1" >
				<div class="col-md-11" >
					<button type="button" class="btn btn-info" ng-click="total()">订单汇总</button>
				</div>
			</div>
			<div class="form-group col-md-3" ng-controller="DatepickerDemoCtrl">
				<div class="col-md-11">
					<div class="input-group">
						<input type="text" class="form-control"
							datepicker-popup="{{selected_format}}" is-open="opened"
							ng-init="selected_format=formats[5]"
							ng-model="timeDeparture.startTime"
							datepicker-options="dateOptions" close-text="Close"
							placeholder="班次时间" readOnly /> <span class="input-group-btn">
							<button type="button" class="btn btn-default"
								ng-click="open($event)">
								<i class="glyphicon glyphicon-calendar"></i>
							</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<input type="text" ng-model="queryMap.orderDetail__terminalStation"
						class="form-control" placeholder="终点站">
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<div class="input-group">
						<ui-select ng-model="imList.selected" theme="bootstrap">
						<ui-select-match placeholder="车票类型">{{$select.selected.name}}</ui-select-match>
						<ui-select-choices
							repeat="im in imList | propsFilter: {name: $select.search}">
						<span ng-bind-html=" im.name| highlight: $select.search"></span> </ui-select-choices>
						</ui-select>
						<span class="input-group-btn">
							<button ng-click="imList.selected = undefined"
								class="btn btn-default">
								<span class="glyphicon glyphicon-trash"></span>
							</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<div class="input-group">
						<ui-select ng-model="agencyList.selected" theme="bootstrap">
							<ui-select-match placeholder="选择代售点">{{$select.selected.name}}</ui-select-match>
							<ui-select-choices repeat="agency in agencyList | propsFilter: {name: $select.search}">
								<span ng-bind-html=" agency.name| highlight: $select.search"></span>
							</ui-select-choices>
						</ui-select>
						<span class="input-group-btn">
							<button ng-click="agencyList.selected = undefined" class="btn btn-default">
								<span class="glyphicon glyphicon-trash"></span>
							</button>
						</span>
					</div>
				</div>
			</div>
            <div class="form-group col-md-1">
                <div class="col-md-11">
                    <button type="button" class="btn btn-info" ng-click="query()">查询</button>
                </div>
            </div>
		</form>
	</div>
	<p ng-show="flag" class="m-l-xl">
		当前总共：{{totalCount | defaultValue: 0}}条数据 &nbsp;
		订单总金额：{{orderTotal | number:2 | defaultValue: 0.00}}元 &nbsp;
		应付金额：{{orderPaymentTotal | number:2 | defaultValue: 0.00}}元 &nbsp;
		申请退款金额：{{orderRefundToatal | number:2 | defaultValue: 0.00}}元 &nbsp;
		保险金额：{{insurancesToatal | number:2 | defaultValue: 0.00}}元 &nbsp;
		票数：{{tickets | defaultValue: 0}}张 &nbsp;
		电子客票金额：{{im | number: 2 | defaultValue: 0.00}}元 &nbsp;
		电子客票票数：{{imTickets | defaultValue: 0}}张 &nbsp;
	</p>
	<div class="table-responsive">
		<table class="table table-striped b-t b-light">
			<thead>
				<tr>
					<th style="width: 20px;"></th>
					<th>订单编号</th>
					<th>联系人</th>
					<th>联系人手机号</th>
					<th>订单总金额</th>
					<th>应付金额</th>
					<th>订单生成时间</th>
					<th>状态</th>
					<th><a has-authority="BOOKING_LIST_EXPORT" href
						tooltip="excel导出"><i class="fa fa-download"
							ng-click="exportExcel()"></i></a></th>
				</tr>
			</thead>
			<tbody>
				<tr ng-repeat="order in dataList">
					<td></td>
					<td>{{order.orderNo}}</td>
					<td>{{order.contactName}}</td>
					<td>{{order.contactPhone}}</td>
					<td>{{order.totalPrice |number:2}}</td>
					<td>{{order.payablePrice |number:2}}</td>
					<td>{{order.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
					<td>{{order.status | orderFilter}}</td>
					<td>
						<div class="row list-icon">
<!-- 							<a href tooltip="手动退款" has-authority="BOOKING_LIST_UPDATE"
								ng-if="order.status==9"
								ui-sref="app.booking.detail({orderId: order.id,status: order.status})"><i
								class="fa  fa-edit"></i></a>
						    <a href tooltip="退票"
								has-authority="BOOKING_LIST_REFUND" ng-if="order.status==3"
								ui-sref="app.booking.detail({orderId: order.id,status: order.status})"><i
								class="fa fa-pencil fa-fw m-r-xs"></i></a> -->
						    <a href tooltip="详情"
								ui-sref="app.booking.detail({orderId: order.id,status: order.status,tag:0,id:0})"
								target="_blank"><i class="fa icon-info"></i></a>
						    <a href
								tooltip="作废" has-authority="BOOKING_LIST_DEL"
								ng-if="order.status==4||order.status==5||order.status==6||order.status==8"><i
								class="fa fa-trash-o" ng-click="del('sm',order,'delete')"></i></a>
						</div>
					</td>
				</tr>
				<tr ng-show="dataList==''">
					<td colspan="9" style="text-align: center;">暂无订单信息</td>
				</tr>
			</tbody>
		</table>
	</div>
	<page-footer />
</div>